package com.eascs.web.o2o.scheduler.task;

import javax.inject.Inject;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.common.util.StopWatch;
import com.eascs.web.o2o.scheduler.service.SendMessageService;

@Component("o2oh5MessageTask")
public class O2oh5SynchroTask {
	protected final Logger logger = LoggerFactory.getLogger(getClass());
	
	@Inject
	SendMessageService sendMessageService;
	
	@Scheduled(cron = "0 30 08 * * ?")
	public void msgSend() {
		logger.info("o2oh5短信定时任务开始......");
		StopWatch stopWatch = new StopWatch();
		sendMessageService.sendMessage();
		logger.info("o2oh5短信定时任务结束，共耗时：[{}]秒", stopWatch.elapsedTime()/1000);
	}
	
	
	@Scheduled(cron = "0 0 14 * * ?")
	public void msgSend1() {
		logger.info("o2oh5短信定时任务开始......");
		StopWatch stopWatch = new StopWatch();
		sendMessageService.sendMessage();
		logger.info("o2oh5短信定时任务结束，共耗时：[{}]秒", stopWatch.elapsedTime()/1000);
	}
	
	
	
}
